<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <!-- Custom styles for this template -->
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
    <script src="../../static/js/jquery-3.6.0.js" th:src="@{/static/js/jquery-3.6.0.js}"
            type="text/javascript"></script>
</head>
<body>
<div th:insert="student/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边栏-->
        <div th:insert="~{student/common::sidebar(active='teacherList.html')}"></div>
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="table-responsive">
                <table class="table table-hover table-bordered table-striped table-sm">
                    <thead>
                    <tr>
                        <th>班级</th>
                        <th>课程</th>
                        <th>老师</th>
                        <th>性别</th>
                        <th>教室</th>
                        <th>必修|选修</th>
                        <th>课程类型</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="list:${List}">
                        <td th:text="${list.getClass_name()}"></td>
                        <td id="subject" th:text="${list.getSubject()}"></td>
                        <td th:text="${list.getTname()}"></td>
                        <td th:text="${list.getGender()}"></td>
                        <td th:text="${list.getClassroom()}"></td>
                        <td id="classes" th:text="${list.getClasses()}"></td>
                        <td id="courseType" th:text="${list.getCourse_type()}"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <nav aria-label="Page navigation" class="page-header">
                <ul class="pagination">
                    <li>
                        <a aria-label="Previous" id="pagePrevious"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page}-1,size=${size})}"
                           th:if="${lastPage}">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a class="nav active" id="page1"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page},size=${size})}"
                           th:if="courseList!=null" th:text="${page}"></a></li>
                    <li><a id="page2"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page+1},size=${size})}"
                           th:if="${number} gt ${page*10}" th:text="${page}+1"></a></li>
                    <li><a id="page3"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page+2},size=${size})}"
                           th:if="${number} gt ${(page+1)*10}" th:text="${page}+2"></a></li>
                    <li><a id="page4"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page+3},size=${size})}"
                           th:if="${number} gt ${(page+2)*10}" th:text="${page}+3"></a></li>
                    <li><a id="page5"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page+4},size=${size})}"
                           th:if="${number} gt ${(page+3)*10}" th:text="${page}+4"></a></li>
                    <li>
                        <a aria-label="Next" id="pageNext"
                           th:href="@{/student/getTeacherByClass/{className}/{page}/{size}(className=${session.student.getSclass()},page=${page}+1,size=${size})}"
                           th:if="${nextPage}">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </main>
    </div>
    <!--<script type="text/javascript" th:src="@{/static/js/jquery-3.2.1.slim.min.js}" src="../../static/js/jquery-3.2.1.slim.min.js"></script>-->
    <script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}"
            type="text/javascript"></script>
    <script src="../../static/js/popper.min.js" th:src="@{/static/js/popper.min.js}" type="text/javascript"></script>
    <!-- <script>
         $(function (){
             let subject = $('#subject').val();
             let classes = $('#classes');
             let courseType = $('#courseType');
             classes.text('result');
             courseType.text('result')
             $.ajax({
                 url:"/student/ajax/getCourse",
                 data:{"subject":subject},
                 type:'get',
                 dataType:'json',
                 success:function (result){
                     classes.text(result.classes);
                     courseType.text(result.course_type)
                 }
             })
         })
     </script>-->
</div>
</body>
</html>